﻿//-------------
// <copyright file="RoleMapper.cs" company="Uncas">
//     Copyright (c) Ole Lynge Sørensen. All rights reserved.
// </copyright>
//-------------

namespace Uncas.Katas.SimpleMembership.Web.Mappers
{
    using AutoMapper;
    using Uncas.Katas.SimpleMembership.Domain;
    using Uncas.Katas.SimpleMembership.Web.ViewModels;

    /// <summary>
    /// Mapper for roles.
    /// </summary>
    public static class RoleMapper
    {
        /// <summary>
        /// Configures this instance.
        /// </summary>
        public static void Configure()
        {
            Mapper.CreateMap<Role, RoleListItemViewModel>();
        }

        /// <summary>
        /// Maps the role to list item view model.
        /// </summary>
        /// <param name="role">The given role.</param>
        /// <returns>The role list item view model.</returns>
        public static RoleListItemViewModel MapRoleToListItemViewModel(
            Role role)
        {
            return Mapper.Map<Role, RoleListItemViewModel>(role);
        }
    }
}